package com.lecture.view.builder;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

import com.lecture.hibernate.pojo.Messagebox;
import com.lecture.view.bean.SendMessageBean;

public class MessageBuilder {

	public static Messagebox createMessagebox(SendMessageBean sendMessageBean) throws IllegalAccessException, InvocationTargetException{
		Messagebox message = new Messagebox();
		BeanUtils.copyProperties(message, sendMessageBean);
		return message;
	}
	
	public static SendMessageBean createSendMessageBean(Messagebox message) throws IllegalAccessException, InvocationTargetException{
		SendMessageBean smessage = new SendMessageBean();
		BeanUtils.copyProperties(smessage, message);
		return smessage;
	}
}
